#include <bits/stdc++.h>
using namespace std;
const int maxn=100005;
struct plane{
	int st,of;
}a[maxn],b[maxn];
bool operator < (const plane a,const plane b)
{
	return a.st<b.st;
}
int t1[maxn],t2[maxn],n,m1,m2;
priority_queue<pair<int,int> ,vector<pair<int,int> >,greater<pair<int,int> > > q;
priority_queue<int,vector<int>,greater<int> > kong;
int id1[maxn],id2[maxn],get1[maxn],get2[maxn];
int main()
{
	freopen("airport.in","r",stdin);
	freopen("airport.out","w",stdout);
	scanf("%d%d%d",&n,&m1,&m2);
	for(int i=1;i<=m1;i++)
		scanf("%d%d",&a[i].st,&a[i].of);
	sort(a+1,a+1+m1);
	for(int i=1;i<=m2;i++)
		scanf("%d%d",&b[i].st,&b[i].of);
	sort(b+1,b+1+m2);
	for(int i=1;i<=m1;i++)kong.push(i);
	for(int i=1;i<=m1;i++)
	{
		int now=a[i].st;
		while(!q.empty()&&q.top().first<a[i].st)
		{
			kong.push(q.top().second);
			q.pop();
		}
		//printf("%d\n",kong.top());
		id1[i]=kong.top();
		kong.pop();
		q.push(make_pair(a[i].of,id1[i]));
	}
	while(!q.empty())q.pop();
	while(!kong.empty())kong.pop();
//	for(int i=1;i<=m1;i++)printf("%d ",id1[i]);putchar('\n');
	for(int i=1;i<=m2;i++)kong.push(i);
	for(int i=1;i<=m2;i++)
	{
		int now=b[i].st;
		while(!q.empty()&&q.top().first<=b[i].st)
		{
			kong.push(q.top().second);
			q.pop();
		}
		//printf("%d\n",kong.top());
		id2[i]=kong.top();
		kong.pop();
		q.push(make_pair(b[i].of,id2[i]));
	}
//	for(int i=1;i<=m2;i++)printf("%d ",id2[i]);putchar('\n');
	int now=0,maxx=-100;
	for(int i=1;i<=m1;i++)get1[id1[i]]++;
	for(int i=1;i<=m2;i++)get2[id2[i]]++;
	//for(int i=1;i<=n;i++)printf("%d ",get1[i]);putchar('\n');
//	for(int i=1;i<=n;i++)printf("%d ",get2[i]);putchar('\n');
	for(int i=1;i<=n;i++)now+=get2[i];
	maxx=max(now,maxx);
	for(int i=1;i<=n;i++)
	{
		now+=get1[i];
		now-=get2[n-i+1];
	//	printf("%d\n",now);
		maxx=max(maxx,now);
	}
	printf("%d",maxx);
}
